package com.qipay.withdraw.config;

/**
 * Creator: Yao
 * Date:    2017/9/27
 * For:
 * Other:
 */
public enum WithdrawStateEnum {

    APPLY((byte) 0, "申请"),
    CANCEL((byte) 1, "取消"),
    PAYED((byte) 2, "出款"),
    REFUND((byte) 3, "退款"),
    UN_PASS((byte) 4, "不通过"),
    UN_SUBMIT((byte) 99, "提交表单");

    private byte state;
    private String info;

    WithdrawStateEnum(byte state, String info) {
        this.state = state;
        this.info = info;
    }

    public byte getState() {
        return state;
    }

    public void setState(byte state) {
        this.state = state;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public static String getInfo(Byte state) {

        String info = "";

        if (null != state) {
            for (WithdrawStateEnum p : WithdrawStateEnum.values()) {
                if (state.equals(p.getState())) {
                    info = p.getInfo();
                    break;
                }
            }
        }

        return info;
    }
}
